<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<h1>0</h1>
<script>
  let count=0;
  setInterval(f,1000);
  function f() {
    count++;
    let h = document.querySelector("h1");
    h.innerText = count;
  }
 /* let t = document.querySelector("h1");
  setInterval(function () {
      switch (count){
        case 0:t.innerText = "欠";
        break;
        case 1:t.innerText = "债";
        break;
        case 2:t.innerText = "还";
        break;
        case 3:t.innerText = "钱";
        break;
      }
      count++;
  },500);//匿名方法开启*/



</script>
</body>
</html>